$("#message").html("<%= @message %>");
<% if @flag %>
function go_to_fixed_costs (){
  window.location.href = "/admin/fixed_costs";
}
setTimeout("go_to_fixed_costs()", 3000)
<%else%>
function close_message (){
  $("#message").html("");
}
setTimeout("close_message()", 2000)
<%end%>
